package com.sfzd5.exam.helplibrary.exam;

public class PageA4 {
    public static final double in2mm = 25.4;
    public static final double pageWidthm = 210;
    public static final double pageHeightm = 297;
    public static double dpi = 72;

    public static float blankSP = 2.5f;

    public static float pageInfoHightm = 25f;

    // 行线宽度
    public static double lineWidthm = 0.2f;
    // 边框线宽度
    public static double boardWidthm = 0.4f;

    public static double optionLineHeightm = 5f; //每行选项高是5mm，字号是3mm

    public static double marginLeftRightm = 15;
    public static double marginTopBottom = 20;

    public static double areaMarginm = 2;

    public static double contextWidthm() {
        return pageWidthm - 2 * marginLeftRightm;
    }

    public static double contextHeightm() {
        return pageHeightm - 2 * marginTopBottom;
    }

    public static double lineHightm = 8;

    //返回每毫米点数
    public static double mm2point(double mm) {
        return dpi * mm / in2mm;
    }

    public static double point2mm(double width) {
        return width * in2mm / dpi;
    }

    public static boolean isInPage(double ym) {
        return ym < pageHeightm - marginTopBottom;
    }

    //A4纸的尺寸
    public static double getPageWidth() {
        return mm2point(pageWidthm);
    } // = 2480;

    public static double getPageHeight() {
        return mm2point(pageHeightm);
    } // = 3508;

}
